<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%
	request.setCharacterEncoding("UTF-8");
	response.setContentType("text/html;charset=UTF-8");
%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%
	String path = request.getContextPath();
%>
<html lang="zh-cn">
<head>
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> 
	<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui" />
	<meta name="apple-mobile-web-app-capable" content="yes" />
	<meta name="format-detection" content="telephone=no, email=no" />
	
 <!-- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <meta name="renderer" content="webkit"> -->
    <title>登录</title>  
    <link rel="stylesheet" href="<%=path %>/admin/css/pintuer.css">
    <link rel="stylesheet" href="<%=path %>/admin/css/admin.css">
    <script type="text/javascript">
    var paths = '<%=path%>';
    </script>
    <script src="<%=path %>/admin/js/jquery.js"></script>
    <script src="<%=path %>/admin/js/pintuer.js"></script>  
    <script src="<%=path %>/admin/js/pic.js"></script>
    <script type="text/javascript" src="<%=path%>/admin/js/lrz.bundle.js" ></script>
    <script type="text/javascript" src="<%=path%>/admin/js/lrz.all.bundle.js" ></script>
	<script type="text/javascript" src="<%=path%>/admin/js/1.chunk.js" ></script>
	<script type="text/javascript" src="<%=path%>/admin/js/2.chunk.js" ></script>
	<script src="<%=path %>/admin/js/admin.js"></script>
		
</head>
<body>
	<div class="panel admin-panel">
  <div class="panel-head" id="add"><strong><span class="icon-pencil-square-o"></span>新增案例</strong></div>
  <div class="body-content">
    <form id="planForm" method="post" class="form-x" action="<%=path %>/planManage/add">  
      <div class="form-group">
        <div class="label">
          <label>案例名称：</label>
        </div>
        <div class="field">
          <input type="text" class="input w50 clear" value="" name="planName" id="planName" data-validate="required:请输入案例名称" />
          <div class="tips"></div>
        </div>
      </div>
      <div class="form-group">
        <div class="label">
          <label>案例描述：</label>
        </div>
        <div class="field">
          <textarea  class="input w50 clear" style="height:130px;overflow-y:scroll;" onKeyDown="LimitTextArea(this)" onKeyUp="LimitTextArea(this)" 
						onkeypress="LimitTextArea(this)" title="您的最大输入长度为100字" name="planDescription" id="planDescription" data-validate="required:请输入案例描述" ></textarea>
          <div class="tips"></div>
        </div>
      </div>
      <div class="form-group">
        <div class="label">
          <label>出品公司：</label>
        </div>
        <div class="field">
          <input type="text" class="input w50 clear" value="" name="planCompnay" id="planCompnay" data-validate="required:请输入出品公司" />
          <div class="tips"></div>
        </div>
      </div>   
      
      <if condition="$iscid eq 1">
        <div class="form-group">
       <!--    <div class="label">
            <label>标签：</label>
            <input name="planTag" id="planTag" type="hidden" value=""/>
          </div> -->
          <input name="planTag" id="planTag" type="hidden" value=""/>
          <div style="width:100%;float:left">
          <div class="label">
            <label>行业：</label>
          </div>
          <div class="field" style="width:80%">
          	 <div class="dx">
          	 	 <!-- <span>行业：</span> -->
          	 	 <ul>
          	 	 	<c:forEach items="${hangyeList }" var="list" varStatus="s">
              			<li><label ><input name="checkTag" class="plantags" type="checkbox" value="${list.dicCode }" /><span>${list.dicName }</span></label></li>
              		</c:forEach>
          	 	 </ul>
          	 </div>
          </div>
         </div>
         <div style="width:100%;float:left">
          <div class="label">
            <label>节日：</label>
          </div>
          <div class="field" style="width:80%">
          	 <div class="dx">
          	 	 <!-- <span>节日：</span> -->
          	 	 <ul>
          	 	 	<c:forEach items="${jieriList }" var="list" varStatus="s">
              			<li><label ><input name="checkTag" class="plantags" type="checkbox" value="${list.dicCode }" /><span>${list.dicName }</span></label></li>
              		</c:forEach>
          	 	 </ul>
          	 </div>
          	</div>
          	</div>
           <div style="width:100%;float:left">
          <div class="label">
            <label>功能：</label>
          </div>
          	<div class="field" style="width:80%">
          	 <div class="dx">
          	 	<!--  <span>功能：</span> -->
          	 	 <ul>
          	 	 	<c:forEach items="${gongnengList }" var="list" varStatus="s">
              			<li><label><input name="checkTag" class="plantags" type="checkbox" value="${list.dicCode }" /><span>${list.dicName }</span></label></li>
              		</c:forEach>
          	 	 </ul>
          	 </div>
          </div>
          </div>
         <div style="width:100%;float:left">
          <div class="label">
            <label>支持PC预览：</label>
          </div>
          	<div class="field" style="width:80%">
          	 <div class="dx">
          	 	<label><input type="radio" value="0" name="planSuitPhone" checked="checked" />是</label>
          	 	<label><input type="radio" value="1" name="planSuitPhone"  />否</label>
          	 </div>
          </div>
          </div>
        </div>
        <div class="form-group">
	        <div class="label">
	          <label>上传封面：</label>
	          <input name="planCover" id="planCover" type="hidden" value=""/>
	          </div>
	        <div class="field" style="width:85%;">				
				<div id="view" style="height:260px;width:356px;margin-top:10px;margin-bottom:40px;border-radius:3px;float:left;border:1px solid #ddd;">
	        </div>
	      </div>
	      
        <div class="form-group">
	        <div class="label">
	          <label>访问地址：</label>
	        </div>
	        <div class="field">
	          <input type="text" class="input w50 clear" value="" name="planUrl" id="planUrl" data-validate="required:请输入访问地址" />
	          <div class="tips"></div>
	        </div>
	      </div>
        <div class="form-group">
					<div class="label">
	          <label>上传照片：</label>
	          <input name="planPics" id="planPics" type="hidden" value=",,,,,,,"/>
	        </div >
	        	<div class="all-pic">
					<div class="qu" style="width:95%;float: left;margin-right: 5%;">						
						<div class="picture" style="position: relative;">
							<a href="#" class="a-upload" id="im1" >
								<input id="file_upload1" type="file" name="img1" class="pics"/>
								<div class="image_container" style="z-index:-1;">
									<img id="preview1" class="imgs">
								</div>      
							</a>
						</div>	    
											

						<div class="picture" style="position: relative;">	
	
							<a href="#" class="a-upload" id="im2">
								<input id="file_upload2" type="file" name="img2" class="pics" /> 
								<div class="image_container" style="z-index:-1;">
									<img id="preview2" class="imgs">
								</div>       
							</a>							
						</div>
	
						<div class="picture" style="position: relative;">	
	
							<a href="#" class="a-upload" id="im3">
	
								<input id="file_upload3" type="file"  name="img3" class="pics" /> 
								<div class="image_container" style="z-index:-1;">
								    <img id="preview3" class="imgs">
								</div>
							</a>
						</div>
						<%-- <span class="btnss"><img src="<%=path%>/admin/images/jia.png" /></span> --%>
						<div class="picture" id="pic4" style="position: relative;">		
							<a href="#" class="a-upload" id="im4">
								<input id="file_upload4" type="file" name="img4" class="pics addpic" /> 
								<div class="image_container" style="z-index:-1;">
								    <img id="preview4" class="imgs">
								    <img id="pre4" class="jiaImg" src="<%=path %>/admin/images/jia.png" style="padding:80px 20px;">
								</div>      
							</a>
						</div>
								
						<div class="picture" id="pic5" style="position: relative;">	
							<a href="#" class="a-upload" id="im5">
							    <input id="file_upload5" type="file" name="img5" class="pics addpic" />
							    <div class="image_container" style="z-index:-1;">
							        <img id="preview5" class="imgs">
							        <img id="pre5" class="jiaImg" src="<%=path %>/admin/images/jia.png" style="padding:80px 20px;" >
							    </div>       
							</a>
						</div>
						<div class="picture" id="pic6" style="position: relative;">	
							<a href="#" class="a-upload" id="im6">
							    <input id="file_upload6" type="file" name="img6" class="pics addpic" />
							    <div class="image_container" style="z-index:-1;">
							        <img id="preview6" class="imgs">
							         <img id="pre6" class="jiaImg" src="<%=path %>/admin/images/jia.png" style="padding:80px 20px;" >
							    </div>       
							</a>
						</div> 
						<div class="picture" id="pic7" style="position: relative;">	
							<a href="#" class="a-upload" id="im7">
							    <input id="file_upload7" type="file" name="img7" class="pics addpic" />
							    <div class="image_container" style="z-index:-1;">
							        <img id="preview7" class="imgs" >
							         <img id="pre7" class="jiaImg" src="<%=path %>/admin/images/jia.png" style="padding:80px 20px;" >
							    </div>       
							</a>
						</div> 
						<div class="picture" id="pic8" style="position: relative;">	
							<a href="#" class="a-upload" id="im8">
							    <input id="file_upload8" type="file" name="img8" class="pics addpic" />
							    <div class="image_container" style="z-index:-1;">
							        <img id="preview8" class="imgs">
							        <img id="pre8" class="jiaImg" src="<%=path %>/admin/images/jia.png" style="padding:80px 20px;" >
							    </div>       
							</a>
						</div> 
					</div>
				</div>
      </div>
      <div class="form-group">
        <div class="label">
          <label></label>
        </div>
        <div class="field">
          <button class="button bg-main icon-check-square-o" type="button" onclick="javascript:sub();"> 提交</button>
          <input type="hidden" name="subTag" id="subTag"/>
        </div>
      </div>
    </form>
  </div>
</div>
</body>
 <script type="text/javascript" src="<%=path%>/admin/js/layer/layer.js" ></script>
<script type="text/javascript">
	$(function(){
		var subTag = '${param.subTag}';
		if(subTag==1){
			layer.msg('操作成功！');
		}else if(subTag== 2){
			layer.msg('系统忙！');
		}
	});
	function LimitTextArea(field){ 
	    maxlimit=100; 
	    if (field.value.length > maxlimit) 
	     field.value = field.value.substring(0, maxlimit);
	  }
	function sub(){
		<%-- var params = {};
		params["planName"] = $("#planName").val();
		params["planDescription"] = $("#planDescription").val();
		params["planCompnay"] = $("#planCompnay").val();
		params["planTag"] = $("#planTag").val();
		params["planUrl"] = $("#planUrl").val();
		params["planPics"] = $("#planPics").val();
		$.ajax({
			type:"post",
			url:"<%=path%>/admin/subPlan",
			data:params,
			success:function(data){

					if(data>0){
						layer.msg('操作成功！');
						$(".clear").val("");
						$("#planTag").val(",,");
						$("select").val("");
						$("#planPics").val(",,,,,,,");
						$(".imgs").attr("src","");
					}else{
						layer.msg('系统忙！');
					}
				
			}
		}); --%>
		$("#planForm").submit();
		
	};
	

	$(".plantags").change(function(){
		var roleitem = "";
		$("input[name='checkTag']").each(function(){
			if($(this).prop("checked")){
				if(roleitem == ""){
				roleitem += $(this).val();
				}
				else{
				roleitem += ","+$(this).val();
				}
			}
		});
		$("#planTag").val(roleitem);
		
	});
	
</script>
<script src="http://www.jq22.com/jquery/2.1.1/jquery.min.js"></script>

<%-- <script src="<%=path %>/admin/js/img/jquery-2.1.1.min.js"></script> --%>
<script>window.jQuery || document.write('<script src="<%=path%>/admin/js/img/jquery-2.1.1.min.js"><\/script>')</script>
<script src="<%=path %>/admin/js/img/iscroll-zoom.js"></script>
<script src="<%=path %>/admin/js/img/jquery.photoClip.js"></script>
<script src="<%=path %>/admin/js/img/photoLayer.js"></script>
<script type="text/javascript">
/* $("#choose").click(function (){
	layer.open({
		  type: 1,
		  skin: 'layui-layer-rim', //加上边框
		  area: ['500px', '500px'], //宽高
		  content: '<div style="padding:10px 45px;"><div id="clipArea" style="height:400px;width:400px;float:left;border:1px solid gray;"></div>'
				+'<div style="margin:5px 5px;float:left;">'
			+'<input type="file" id="addfile" name="img10" class="pics" >'
			+'<button type="button" id="file_upload10">截取</button>'				
			+'</div></div>'
		});
	$("#clipArea").photoClip({
		width: 356,
		height: 260,
		file: "#addfile",
		view: "#choose",
		ok: "#file_upload10",
		loadStart: function() {
			console.log("照片读取中");
		},
		loadComplete: function() {
			console.log("照片读取完成");
		},
		clipFinish: function(dataURL) {
			 console.log(dataURL); 
			layer.closeAll();
		}
	});
}); */


</script>
</html>